package ru.pb.global.data.model;

import java.awt.Color;

public class PlayerInfo
{
	// Общее
	private int _player_id, _rank, _gp, _money, _exp, _pcCafe;
	private String _player_name;
	// Сезонная статистика
	private int _fights_s;
	private int _fights_win_s;
	private int _fights_lost_s;
	private int _kills_count_s;
	private int _deaths_count_s;
	private int _escape_s;
	// Не сезонная статистика
	private int _fights_ns;
	private int _fights_win_ns;
	private int _fights_lost_ns;
	private int _kills_count_ns;
	private int _deaths_count_ns;
	private int _escape_ns;

	private long _create_date;
	private int _lastAccess, _onlinetime;
	private boolean _online;
	private int _nameColor;
	private Color _fakeNameColor;

	// Клановая инфа.
	private ClanInfo _clanInfo;
	// Инвентарь.
	private InventoryInfo _invInfo;

	public PlayerInfo()
	{
		_player_id = 0;
		_player_name = "";

		_rank = 0;
		_gp = 0;
		_exp = 0;
		_pcCafe = 0;

		_fights_s = 0;
		_fights_win_s = 0;
		_fights_lost_s = 0;
		_kills_count_s = 0;
		_deaths_count_s = 0;
		_escape_s = 0;

		_fights_ns = 0;
		_fights_win_ns = 0;
		_fights_lost_ns = 0;
		_kills_count_ns = 0;
		_deaths_count_ns = 0;
		_escape_ns = 0;

		_create_date = 0;
		_lastAccess = 0;
		_onlinetime = 0;
		_online = false;
	}

	public int getPlayerId()
	{
		return _player_id;
	}

	public void setPlayerId(int id)
	{
		_player_id = id;
	}

	public String getPlayerName()
	{
		return _player_name;
	}

	public void setPlayerName(String name)
	{
		_player_name = name;
	}

	public int getRank()
	{
		return _rank;
	}

	public void setRank(int r)
	{
		_rank = r;
	}

	public int getGamePoint()
	{
		return _gp;
	}

	public void setGamePoint(int point)
	{
		_gp = point;
	}

	public int getMoney()
	{
		return _money;
	}

	public void setMoney(int money)
	{
		_money = money;
	}

	public int getExp()
	{
		return _exp;
	}

	public void setExp(int exp)
	{
		_exp = exp;
	}

	public int getPcCafe()
	{
		return _pcCafe;
	}

	public void setPcCafe(int pcCafe)
	{
		_pcCafe = pcCafe;
	}

	public int getFights(boolean season)
	{
		return season ? _fights_s : _fights_ns;
	}

	public void setFights(int val, boolean season)
	{
		if(season)
			_fights_s = val;
		else
			_fights_ns = val;
	}

	public int getWinFights(boolean season)
	{
		return season ? _fights_win_s : _fights_win_ns;
	}

	public void setWinFights(int val, boolean season)
	{
		if(season)
			_fights_win_s = val;
		else
			_fights_win_ns = val;
	}

	public int getLostFights(boolean season)
	{
		return season ? _fights_lost_s : _fights_lost_ns;
	}

	public void setLostFights(int val, boolean season)
	{
		if(season)
			_fights_lost_s = val;
		else
			_fights_lost_ns = val;
	}

	public int getKills(boolean season)
	{
		return season ? _kills_count_s : _kills_count_ns;
	}

	public void setKills(int val, boolean season)
	{
		if(season)
			_kills_count_s = val;
		else
			_kills_count_ns = val;
	}

	public int getDeaths(boolean season)
	{
		return season ? _deaths_count_s : _deaths_count_ns;
	}

	public void setDeaths(int val, boolean season)
	{
		if(season)
			_deaths_count_s = val;
		else
			_deaths_count_ns = val;
	}

	public int getEscapes(boolean season)
	{
		return season ? _escape_s : _escape_ns;
	}

	public void setEscapes(int val, boolean season)
	{
		if(season)
			_escape_s = val;
		else
			_escape_ns = val;
	}

	public long getCreateDate()
	{
		return _create_date;
	}

	public void setCreateDate(long val)
	{
		_create_date = val;
	}

	public int getLastAccess()
	{
		return _lastAccess;
	}

	public void setLastAccess(int val)
	{
		_lastAccess = val;
	}

	public int getOnlineTime()
	{
		return _onlinetime;
	}

	public void setOnlineTime(int val)
	{
		_onlinetime = val;
	}

	public boolean isOnline()
	{
		return _online;
	}

	public void setOnline(boolean val)
	{
		_online = val;
	}

	public void setNameColor(int color)
	{
		_nameColor = color;
	}

	public int getNameColor(boolean canFake)
	{
		return canFake ? _fakeNameColor != null  ? _fakeNameColor.getRGB() : _nameColor : _nameColor;
	}

	public void setFakeNameColor(Color color)
	{
		_fakeNameColor = color;
	}

	public ClanInfo getClanInfo()
	{
		return _clanInfo != null ? _clanInfo : new ClanInfo();
	}

	public void setClanInfo(ClanInfo clanInfo)
	{
		_clanInfo = clanInfo;
	}

	public InventoryInfo getInventoryInfo()
	{
		return _invInfo != null ? _invInfo : new InventoryInfo();
	}

	public void setInventoryInfo(InventoryInfo invInfo)
	{
		_invInfo = invInfo;
	}
}